import React from 'react'
import ReactDOM from 'react-dom/client'
import { ConfigProvider } from 'antd'
import { Provider } from 'react-redux'
import zhCN from 'antd/es/locale/zh_CN' // antd中提供的内置语言包.下载了antd,就已经下载好语言包了,无需额外下载
import jaJP from 'antd/es/locale/ja_JP'
import './index.css'
import App from './App'
import reportWebVitals from './reportWebVitals'

// 引入store.ts
import store from './store'

// 引入i18n的初始化文件(只需要执行一下)
// import './locales/i18n'
// 引入antd的css文件
import 'antd/dist/antd.css'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
  // 这是antd中提供的,用于解决antd组件内置文本国际化的组件.ConfigProvider的作用就是把语言包传递下去
  // locale属性的值应该传入的是语言包
  <ConfigProvider locale={jaJP}>
    {/* 目的: 传递store */}
    <Provider store={store}>
      <React.StrictMode>
        <App />
      </React.StrictMode>
    </Provider>
  </ConfigProvider>
)

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals()
